<template>
  <div class="customerDiv" :class="{ 'clickabled': clickAbled }" @click="clickHandler">
    {{ transResult }}
  </div>
</template>
<script>
export default {
  props: ['dictionaries', 'code', 'clickAbled', 'id'],
  data() {
    return {
      //   dictionaries: [
      //     //审核状态 0-未审核 1-已审核 -2 审核拒绝
      //     {
      //       code: 0,
      //       name: "未审核",
      //     },
      //     {
      //       code: 1,
      //       name: "已审核",
      //     },
      //     {
      //       code: 2,
      //       name: "审核拒绝",
      //     },
      //   ],
    }
  },
  computed: {
    transResult() {
      let name = ''
      this.dictionaries.forEach((element) => {
        if (element.code === this.code) {
          name = element.name
        }
      })
      return name
    }
  },
  methods: {
    clickHandler() {
      const vm = this
      if (vm.clickAbled) {
        vm.$emit('click', vm.id)
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.clickabled {
  color: #5c90d2;
  cursor: pointer;
}
</style>
